<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改上市公司指数</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/global.css" media="all">
    <script type="text/javascript" src="/plugins/layui/layui.js"></script>
    <style>
        .layui-form-label {
            width: 10%;
        }
        .layui-input-block {
            margin-left: 13%;
        }
        img {
            width: 200px;
            height: 120px;
        }
        .layui-upload-list {
            margin-left: 13%;
        }
    </style>
</head>
<body>
<div style="margin: 15px;">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>编辑上市公司指数(<label class="layui-required-tip">标红的为必填项</label>)</legend>
        <!--<div class="layui-input-block">-->

        <!--</div>-->
    </fieldset>
    <form class="layui-form" id="layui-form" action="">
        <div class="layui-form-item" style="display: none;">
            <label class="layui-form-label layui-required-tip">ID：</label>
            <div class="layui-input-block">
                <input type="text" id="id" name="id" lay-filter="required" autocomplete="off" class="layui-input" value="${lcindex.id!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">证券代码：</label>
            <div class="layui-input-block">
                <input type="text" id="securitiesCode" name="securitiesCode" maxlength="50" lay-verify="required" autocomplete="off" class="layui-input" value="${lcindex.securitiesCode!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">证券简称：</label>
            <div class="layui-input-block">
                <input type="text" id="securitiesAbbreviation" maxlength="50" name="securitiesAbbreviation" lay-verify="required" autocomplete="off" class="layui-input" value="${lcindex.securitiesAbbreviation!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">项目进展：</label>
            <div class="layui-input-block">
                <input type="text" id="projectProgress" name="projectProgress" onkeyup="eventSscm();" maxlength="11" lay-verify="required|number" autocomplete="off" class="layui-input" value="${lcindex.projectProgress!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">团队建设：</label>
            <div class="layui-input-block">
                <input type="text" id="teamBuilding" name="teamBuilding" onkeyup="eventSscm();" lay-verify="required|number" maxlength="11" autocomplete="off" class="layui-input" value="${lcindex.teamBuilding!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">外联合作：</label>
            <div class="layui-input-block">
                <input type="text" id="outreachCooperation" onkeyup="eventSscm();" name="outreachCooperation" lay-verify="required|number" maxlength="11" autocomplete="off" class="layui-input" value="${lcindex.outreachCooperation!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">资本投入：</label>
            <div class="layui-input-block">
                <input type="text" id="capitalInvestment" onkeyup="eventSscm();" name="capitalInvestment" lay-verify="required|number" maxlength="11" autocomplete="off" class="layui-input" value="${lcindex.capitalInvestment!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">实施层面小计：</label>
            <div class="layui-input-block">
                <input type="text" id="implementationSubtotal" readonly="readonly" name="implementationSubtotal" lay-verify="required|number" maxlength="11" autocomplete="off" class="layui-input" value="${lcindex.implementationSubtotal!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">公司市值：</label>
            <div class="layui-input-block">
                <input type="text" id="companyMarketValue" onkeyup="eventGszs();" name="companyMarketValue" lay-verify="required|number" maxlength="11" autocomplete="off" class="layui-input" value="${lcindex.companyMarketValue!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">wind概念：</label>
            <div class="layui-input-block">
                <input type="text" id="windConcept" name="windConcept" onkeyup="eventGszs();" lay-verify="required|number" autocomplete="off" maxlength="11" class="layui-input" value="${lcindex.windConcept!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">公司自身小计：</label>
            <div class="layui-input-block">
                <input type="text" id="companyItselfSubtotal" readonly="readonly" name="companyItselfSubtotal" lay-verify="required|number" maxlength="11" autocomplete="off" class="layui-input" value="${lcindex.companyItselfSubtotal!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">战略层面：</label>
            <div class="layui-input-block">
                <input type="text" id="strategicLevel" name="strategicLevel" onkeyup="eventZlcm();" lay-verify="required|number" autocomplete="off" maxlength="11" class="layui-input" value="${lcindex.strategicLevel!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">战略层面小计：</label>
            <div class="layui-input-block"> 
                <input type="text" id="strategicLevelSubtotal" readonly="readonly" name="strategicLevelSubtotal" lay-verify="required|number" maxlength="11" autocomplete="off" class="layui-input" value="${lcindex.strategicLevelSubtotal!}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">指数：</label>
            <div class="layui-input-block">
                <input type="text" id="index" name="index" lay-verify="required|number" autocomplete="off" maxlength="11" class="layui-input" value="${lcindex.index!}">
            </div>
        </div>
        <div class="layui-form-item"style="display: none;">
            <label class="layui-form-label layui-required-tip">是否启用：</label>
            <div class="layui-input-block">
                <#if (lcindex.enableFlag)?? && lcindex.enableFlag==true>
                    <input type="radio" name="enableFlag" value="1" title="是" checked>
                    <input type="radio" name="enableFlag" value="0" title="否">
                <#else>
                    <input type="radio" name="enableFlag" value="1" title="是">
                    <input type="radio" name="enableFlag" value="0" title="否" checked>
                </#if>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="save">立即提交</button>
                <a class="layui-btn" onclick="javascript:history.back();">返回</a>
            </div>
        </div>
    </form>
</div>
<script>
    layui.use(['jquery','table','laydate','layer','form','util','upload'],function(){
        var $=layui.jquery,table=layui.table,laydate = layui.laydate,
            layer = layui.layer,form = layui.form,util=layui.util,upload = layui.upload;
        
      //计算实施层面小计
        function sumSscm(){
        	var total=(parseFloat(projectProgress.value==""?0:projectProgress.value)
        	+parseFloat(teamBuilding.value==''?0:teamBuilding.value)
        	+parseFloat(outreachCooperation.value==''?0:outreachCooperation.value)
        	+parseFloat(capitalInvestment.value==''?0:capitalInvestment.value));
        	return total;
        }
        
        window.eventSscm=function(){
        	implementationSubtotal.value=sumSscm();
        }
        
      //公司自身小计
        function sumGszs(){
        	var total=(parseFloat(companyMarketValue.value==""?0:companyMarketValue.value)
        	+parseFloat(windConcept.value==''?0:windConcept.value));
        	return total;
        }
        
        window.eventGszs=function(){
        	companyItselfSubtotal.value=sumGszs();
        }
        
      //公司自身小计
        function sumZlcm(){
        	var total=(parseFloat(strategicLevel.value==""?0:strategicLevel.value));
        	return total;
        }
        
        window.eventZlcm=function(){
        	strategicLevelSubtotal.value=sumZlcm();
        }

      //提交
        form.on('submit(save)', function (data) {
        	data.field.id="${lcindex.id}";
            $.ajax({
                url: '/manage/listed/updateListedCompanyIndex',
                type: "post",
                dataType: "json",
                data: data.field,
                success: function (data) {
                	layer.alert(data.msg, {
            		    skin: 'layui-layer-molv' //样式类名  自定义样式
            		    ,closeBtn: 1    // 是否显示关闭按钮
            		    ,anim: 1 //动画类型
            		    ,btn: ['确定'] //按钮
            		    ,icon: data.code>=0?1:2    // icon
            		    ,yes:function(index){
            		    	if (data.code >= 0) {
            	                  location.href = "/manage/listed/listedManage";
            	              }else{
            	            	  layer.close(index);
            	              }
            		    }});
                }
            });
            return false;
        });
    })
</script>
</body>
</html>